/*
 * @Description: 
 * @Author: HKH
 * @Date: 2024-10-10 14:33:55
 * @LastEditors: HKH
 * @LastEditTime: 2024-10-10 14:48:58
 */
//线程类属于lang包，不需要导包
public class MyThread extends Thread{
    @Override
    public void run(){
        for(int i=0;i<10;i++){
            System.out.println("Thread run");
            try{
                Thread.sleep(1000);//睡眠1000毫秒在运行
            }
            catch(InterruptedException e){
                //线程执行终端会抛出异常
                System.out.println("线程中断");
                e.printStackTrace();
            }
        }
    } 
}